package cache

import (
	"time"
	"strconv"
	"strings"
)

const (
	SlidingExpiration = iota;
	AbsoluteExpiration
)

type CacheItem struct {
	Key string;
	Value interface{};
	Duration time.Duration;
	expire int64;
	NoSlidingExpiration int
}

func (item *CacheItem) String() string {

	array := []string{
		"key:",item.Key,
		",value:",item.Value.(string),
		",duration:", item.Duration.String(),
		",Expire:",strconv.FormatInt(item.expire,10),
		",NoSlidingExpiration:", strconv.Itoa(item.NoSlidingExpiration)}

	return strings.Join(array," ");
}